package com.jinzecloud.reportapproval.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jinzecloud.reportapproval.bean.SecurityCheckRecordForm;
import com.jinzecloud.reportapproval.service.SecurityCheckRecordFormService;
import com.jinzecloud.reportapproval.utils.PageUtils;
import com.jinzecloud.reportapproval.utils.R;



/**
 * 安全性检测记录表
 *
 * @author æ­å°
 * @email 1971240051@qq.com
 * @date 2024-12-03 16:18:45
 */
@RestController
@RequestMapping("reportapproval/securitycheckrecordform")
public class SecurityCheckRecordFormController {
    @Autowired
    private SecurityCheckRecordFormService securityCheckRecordFormService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("reportapproval:securitycheckrecordform:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = securityCheckRecordFormService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("reportapproval:securitycheckrecordform:info")
    public R info(@PathVariable("id") Integer id){
		SecurityCheckRecordForm securityCheckRecordForm = securityCheckRecordFormService.getById(id);

        return R.ok().put("securityCheckRecordForm", securityCheckRecordForm);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("reportapproval:securitycheckrecordform:save")
    public R save(@RequestBody SecurityCheckRecordForm securityCheckRecordForm){
		securityCheckRecordFormService.save(securityCheckRecordForm);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("reportapproval:securitycheckrecordform:update")
    public R update(@RequestBody SecurityCheckRecordForm securityCheckRecordForm){
		securityCheckRecordFormService.updateById(securityCheckRecordForm);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("reportapproval:securitycheckrecordform:delete")
    public R delete(@RequestBody Integer[] ids){
		securityCheckRecordFormService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
